home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / gs261sr4.zip / MARKPATH.PS < prev    next >
Text File  |  1993-05-12  |  2KB  |  61 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. %
  3. % This file is part of Ghostscript.
  4. %
  5. % Ghostscript is distributed in the hope that it will be useful, but
  6. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. % to anyone for the consequences of using it or for whether it serves any
  8. % particular purpose or works at all, unless he says so in writing.  Refer
  9. % to the Ghostscript General Public License for full details.
  10. %
  11. % Everyone is granted permission to copy, modify and redistribute
  12. % Ghostscript, but only under the conditions described in the Ghostscript
  13. % General Public License.  A copy of this license is supposed to have been
  14. % given to you along with Ghostscript so you can know your rights and
  15. % responsibilities.  It should be in a file named COPYING.  Among other
  16. % things, the copyright notice and this notice must be preserved on all
  17. % copies.
  18.  
  19. % markpath.ps
  20. % Mark the corners of a path, drawing it slowly if desired.
  21.  
  22. /Delay where { pop } { /Delay 0 def } ifelse
  23. /setxy0
  24.  { currentpoint /y0 exch def /x0 exch def
  25.  } def
  26. /bip
  27.  { epsx epsy idtransform /ey exch def /ex exch def
  28.    currentpoint ex 2 div ey 2 div rlineto currentpoint 0 ey neg rlineto
  29.    ex neg 0 rlineto 0 ey rlineto lineto lineto
  30.    stroke
  31.  } def
  32. /dally
  33.  { Delay { } repeat
  34.  } def
  35. /movebip
  36.  { /xs 2 index def /ys 1 index def
  37.    gsave newpath mpmx transform moveto setxy0 bip grestore
  38.  } def
  39. /linebip
  40.  { gsave newpath x0 y0 moveto mpmx transform lineto setxy0 bip dally grestore
  41.  } def
  42. /curvebip
  43.  { gsave newpath x0 y0 moveto 5 index 5 index mpmx transform lineto bip
  44.    2 copy mpmx transform moveto 3 index 3 index mpmx transform lineto bip
  45.    x0 y0 moveto
  46.    3 { mpmx transform 6 2 roll } repeat
  47.    curveto setxy0 bip dally grestore
  48.  } def
  49. /closebip
  50.  { xs ys linebip
  51.  } def
  52.  
  53. /markpath        % <matrix> markpath -
  54.  { /mpmx exch def 
  55.    gsave initgraphics 9 dup dtransform grestore
  56.      /epsy exch def   /epsx exch def
  57.    gsave 0 setlinewidth
  58.     { movebip } { linebip } { curvebip } { closebip } pathforall
  59.    grestore
  60.  } def
  61.